package ch.usi.inf.pf2.node;

import ch.usi.inf.pf2.cell.NumericValue;
import ch.usi.inf.pf2.cell.Value;
import ch.usi.inf.pf2.node.Constant;
import ch.usi.inf.pf2.node.Subtraction;
import junit.framework.TestCase;
/**
 * A SubtractionTest ,it tests if Subtraction class works or not.
 * 
 * @author Elham.menzer@gmail.com
 */
public class SubtractionTest extends TestCase {
	

		
	public void testCompute(){
		//(3-10)-15
		Node n =new Subtraction(
				new Subtraction(
						new Constant (3),
						new Constant (10)
						),
						new Constant(15));
		Value  v = n.evaluate();
		assertEquals(-22.0,((NumericValue)v).get());
						
	}
		

}

